import 'package:Smart/pages/productor007/studytest/flutter_boss/model/message.dart';
import 'package:flutter/material.dart';
// import 'package:flutter_boss/main.dart';
// import 'package:flutter_boss/model/message.dart';

class MessageListItem extends StatelessWidget {
  final Message message;

 MessageListItem(this.message);
  @override
  Widget build(BuildContext context) {
    return SizedBox(
      child: Card(
        elevation: 0.0,
        child: Row(
          children: <Widget>[
            Padding(
              padding: EdgeInsets.only(
                left: 15.0, right: 15.0, bottom: 0.0),  
                // child: Text('${message.avatar}'),
              child: CircleAvatar(
                radius: 35.0,
                backgroundImage: NetworkImage(message.avatar) ,
              ), 
            ),
            Expanded(
              child:Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                mainAxisSize: MainAxisSize.min,
                children: [
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      Container(
                        child:Text(
                          message.name,
                          textAlign: TextAlign.left,
                          style: TextStyle(fontSize: 15.0),
                        ),
                      ),
                      Padding(
                        padding: const EdgeInsets.only(left: 0.0),
                        child: Text(
                          message.company + " | " + message.position,
                          style: TextStyle(fontSize: 13.0,color:Colors.grey),
                        ), 
                      ),
                      Padding(
                        padding: const EdgeInsets.only(right: 10.0),
                        child: Text(
                          message.time,
                          style: TextStyle(fontSize: 13.0,color:Colors.grey),
                        ), 
                      ),
                    ],
                  ),
                  Padding(
                    padding: const EdgeInsets.only(top: 5.0,left: 0.0,right: 5.0,bottom: 10.0),
                    child: Text(
                      message.msg,
                      style: TextStyle(fontSize: 13.0,color:Colors.grey),
                    ), 
                  ),
                ],
              ) 
            ),
          ],
        )
      ),
    );
  }
}
